/**
 * @file feiyin_ir02f.h
 * @author Quincy(wangqyfm@foxmail.com)
 * @brief Feiyin Cloud IR02F
 * @version 0.1
 * @date 2021-05-03
 *
 * @copyright Copyright (c) 2021 Quincy(wangqyfm@foxmail.com)
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#ifndef __FEIYIN_IR02F_DRIVER_H__
#define __FEIYIN_IR02F_DRIVER_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <device.h>

typedef int (*ir02f_api_transmit)(const struct device * dev, int code);
typedef int (*ir02f_api_copy)(const struct device * dev, int code);

__subsystem struct ir02f_driver_api {
	ir02f_api_transmit transmit;
    ir02f_api_copy copy;
};

__syscall     int        ir02f_transmit(const struct device *dev, int code);
static inline int z_impl_ir02f_transmit(const struct device *dev, int code)
{
	const struct ir02f_driver_api *api = dev->api;

	__ASSERT(api->transmit, "Callback pointer should not be NULL");

	return api->transmit(dev, code);
}

__syscall     int        ir02f_copy(const struct device *dev, int code);
static inline int z_impl_ir02f_copy(const struct device *dev, int code)
{
	const struct ir02f_driver_api *api = dev->api;

	__ASSERT(api->copy, "Callback pointer should not be NULL");

	return api->copy(dev, code);
}

#ifdef __cplusplus
}
#endif

#include <syscalls/feiyin_ir02f.h>

#endif /* __FEIYIN_IR02F_DRIVER_H__ */
